import type { aaa, CardDetail, CardListData, CardListParams, CardParams } from "@/types/card";
import { request } from "@/utils/reuqest";

// 获取月卡数据
export const getCardListAPI=(params:CardListParams)=>{
    return  request<CardListData>('/parking/card/list', 'GET',params)
}
//添加月卡
export  const addCardAPI=(params:Partial<CardParams>)=>{
    return request('/parking/card', "POST" ,params)
    
}

// 编辑月卡详情数据
export const getCardDetailAPI=(id:string)=>{
    return request<CardDetail>(`/parking/card/detail/${id}`,'GET' )
}

/**
 * 编辑月卡
 * @param {*} data
 * @returns
 */
export const updateCardAPI = (data: Partial<aaa>) => {
    return request('/parking/card/edit', 'PUT', data)
  }
 

// 删除月卡
export const deleteCardAPI=(ids:number[])=>{
    // return request(`/parking/card/delete/${id}`,'DELETE')
    return   request(`/parking/card/${ids.join(',')}`,'DELETE')
}


